package com.zsy.dao;

import com.zsy.pojo.Employee;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmployeeDao {

    @Select("SELECT * FROM employee where username=#{username}")
    Employee login(Employee employee);

    @Insert("insert into employee values(null,#{username},#{name},#{password},#{phone},#{sex},#{idNumber},#{status},#{createTime},#{updateTime},#{createUser},#{updateUser});")
    void sace(Employee employee);

    List<Employee> findByName(@Param("name") String name);

    void update(Employee employee);

    @Select("select * from employee where id=#{id}")
    Employee findById(long id);
}
